package org.skyui.config;

import java.util.HashMap;
import java.util.Map;

import org.skyui.beanmanagers.BeanSetManager;
import org.skyui.beans.OrganizationBean;
import org.skyui.views.AbstractBeansTableView.Action;

import com.baycrypt.server.beans.commands.DeviceLockCommandBean;
import com.baycrypt.server.beans.commands.WLANRotateKeyCommandBean;
import com.baycrypt.server.beans.devices.AccessPointBean;
import com.baycrypt.server.beans.devices.DeviceBean;
import com.baycrypt.server.beans.devices.WLANSwitchBean;
import com.baycrypt.server.beans.networks.WLANBean;
import com.baycrypt.server.beans.people.PendingUserBean;
import com.baycrypt.server.beans.people.UserBean;
import com.baycrypt.server.beans.people.UserGroupBean;
import com.baycrypt.server.beans.people.UserInvitationBean;

public class BeanCreateViewConfig {

	protected String actionButtonName;;

	public BeanCreateViewConfig(String actionButtonName) {
		this.actionButtonName = actionButtonName;
	}

	static Map<Class, BeanCreateViewConfig> configMap = new HashMap<Class, BeanCreateViewConfig>();

	public final static Action[] DEFAULT_ACTIONS = new Action[] { Action.ADD,
			Action.REMOVE };

	static {
		configMap.put(DeviceLockCommandBean.class, new BeanCreateViewConfig(
				"Transmit Command to Device"));
		configMap.put(WLANRotateKeyCommandBean.class, new BeanCreateViewConfig(
				"Transmit Command to Devices"));

	}

	private String getActionButtonName() {
		return this.actionButtonName;
	}


	public static String getActionButtonName(BeanSetManager commandManager) {
		BeanCreateViewConfig bc = configMap.get(commandManager.getBeanClass());
		if (bc != null)
		return bc.getActionButtonName();
		else 
			return "Save";
	}

};